/**
 * 
 */
package top.ewind.sender;

import top.ewind.model.SysDictory;
import top.ewind.util.MailUtil;

/**
 * @author wangchao
 *
 */
public class MailSender implements Sender {

	private MailUtil sendmail = null;
	
	public MailSender() {
 		sendmail = new MailUtil(); 		
 		sendmail.setHost(SysDictory.getConfig("mailHost"));
 		sendmail.setUserName(SysDictory.getConfig("mailFrom"));
 		sendmail.setPassWord(SysDictory.getConfig("mailPassword")); 		
 		sendmail.setFrom(SysDictory.getConfig("mailFrom"));
	}

	public void send(String username, String content) {
 		sendmail.setTo(username);
 		sendmail.setSubject("系统通知");
 		sendmail.setContent(content);
 		sendmail.sendMail();
	}

}
